//
//  TableEmoController.m
//  HappyTravel
//
//  Created by Apple on 2018/8/2.
//  Copyright © 2018年 Apple. All rights reserved.
//

#define Start_X          0.0f
#define Start_Y          5.0f
#define Width_Space      10.0f
#define Height_Space     10.0f
#define Button_Height    50.0f
#define Button_Width    (ScreenWidth-30-30)/4

#import "TableEmoController.h"
#import "ButtonReeCell.h"
#import "AseButton.h"
#import "PickerButton.h"
#import <PGDatePicker/PGDatePickManager.h>

@interface TableEmoController () <UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,PGDatePickerDelegate> {
    
    NSArray *_titleArr;
    NSArray *_imageArr;
    NSArray *_selectImageArr;
    
    NSInteger _travelTools;
    NSInteger _SelectTravelTools;
}
@property(nonatomic, assign)float  window_measurable;
@property(nonatomic, assign)NSInteger  phoneControllerPlist;
@property(nonatomic, copy)NSArray *  most;
@property(nonatomic, assign)NSInteger  dateFlow;



@property (nonatomic, strong) UIView *topView;

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UIView *headerBackView;
@property (nonatomic, strong) UIView *headerView;

@property (nonatomic, strong) UITextField *startPointTextField;
@property (nonatomic, strong) UITextField *endPointTextField;
@property (nonatomic, strong) UITextField *dateTextField;
@property (nonatomic, strong) UITextField *phoneTextField;
@property (nonatomic, strong) NSMutableArray<PickerButton *> *leftBtnArray;
@property (nonatomic, strong) UIButton *addBtn;

@property (nonatomic, strong) NSMutableArray<AseButton *> *btnArray;
@property (nonatomic, strong) NSMutableArray *travleArr;
@property (nonatomic, strong) NSMutableArray *singleTravleArr;

@end

@implementation TableEmoController

-(NSString *)andOrientationsInit:(NSString *)originBlock modity:(Boolean)modity geometry:(CGFloat)geometry {
    NSMutableString *fopDefeatEar = [NSMutableString new];

    return fopDefeatEar;

}


- (void)viewWillAppear:(BOOL)animated {

    NSString * wellestablished = [self andOrientationsInit:@"ideology" modity:YES geometry:3686.0];

    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = YES;
    self.tabBarController.tabBar.hidden = NO;
    [[UIApplication sharedApplication] setStatusBarStyle:(UIStatusBarStyleLightContent)];
    [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide];
}

-(NSInteger)navDefault{
     CGFloat manegerEmo = 6528.0;
    NSInteger wire = 0;
    manegerEmo = manegerEmo;
    wire /= MAX(manegerEmo, 1);

    return wire;

}





- (void)viewWillDisappear:(BOOL)animated {

         NSInteger expatiateApe = [self navDefault];

      if (expatiateApe > 59) {
             NSLog(@"%ld",expatiateApe);
      }



    [super viewWillDisappear:animated];
    self.navigationController.navigationBar.hidden = NO;
}

-(NSDictionary *)zoomingDown:(long)progress averageOrigin:(CGFloat)averageOrigin outPhone:(NSArray *)outPhone {
     float headMarch = 644.0;
     int odel = 4132;
    NSMutableDictionary * sober = [NSMutableDictionary dictionaryWithObject:@(121)forKey:@"moderatorImputation"];
    headMarch -= headMarch;
    headMarch /= MAX(odel, 1);
    [sober setObject: @(headMarch) forKey:@"nothingFarrowDose"];

    return sober;

}

- (void)viewDidAppear:(BOOL)animated {

         NSDictionary * insouciant = [self zoomingDown:689 averageOrigin:5298.0 outPhone:[NSArray arrayWithObjects:@(715), @(389), @(825), nil]];

      [insouciant enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
          if ([key isEqualToString:@"login"]) {
              NSLog(@"value: %@", obj);
          }else {
              NSLog(@"key: %@, value: %@", key, obj);
          }
      }];



    [super viewDidAppear:animated];
    self.tabBarController.tabBar.hidden = NO;
}

-(NSDictionary *)clickLong:(Boolean)control photoUtton:(Boolean)photoUtton {
    NSMutableDictionary * agentFussyScream = [NSMutableDictionary dictionaryWithCapacity:325];

    return agentFussyScream;

}





- (void)viewDidLoad {

         NSDictionary * evaporateChronicle = [self clickLong:NO photoUtton:YES];

      [evaporateChronicle enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
          if ([key isEqualToString:@"odel"]) {
              NSLog(@"value: %@", obj);
          }else {
              NSLog(@"key: %@, value: %@", key, obj);
          }
      }];



    [super viewDidLoad];
    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    }else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    self.view.backgroundColor = [UIColor whiteColor];

    [self loadData];
    [self didUpdateBecome];
}

#pragma mark - CustomMethod
- (void)loadData {
    
    _titleArr = @[@"Aircraft",@"Train",@"Bus",@"Driving"];
    _imageArr = @[@"transition",@"imaConsult",@"phoneTime",@"checkOodHead"];
    _selectImageArr = @[@"scroll",@"appPing",@"omeMainNe",@"itemIco"];
    
    [self initData];
}

- (void)initData {
    
    [self.travleArr removeAllObjects];
    [self.singleTravleArr removeAllObjects];
    self.travleArr = [HTSingleton readModelArrayForDocument:TravelModelPath];
    for (TralvelModel *model in self.travleArr) {
        if (model.travelTools == _SelectTravelTools) {
            [self.singleTravleArr addObject:model];
        }
    }
    [self.tableView reloadData];
}

-(int)staticsImage:(Boolean)ddPrefix ab:(long)ab monthMood:(Boolean)monthMood {
    int swallowJournalLearning = 0;

    return swallowJournalLearning;

}





- (void)didUpdateBecome{

         int undermine = [self staticsImage:YES ab:822 monthMood:YES];

      for(int i = 0; i < undermine; i++) {
          if (i == 3) {
              break;
          }
      }



    
    [self.view addSubview:self.topView];
    [self.view addSubview:self.tableView];
    [self.headerBackView addSubview:self.startPointTextField];
    [self.headerBackView addSubview:self.endPointTextField];
    [self.headerBackView addSubview:self.dateTextField];
    [self.headerBackView addSubview:self.phoneTextField];
    [self contentLabel];
    [self.headerBackView addSubview:self.addBtn];
    self.tableView.tableHeaderView = self.headerBackView;
}

- (void)contentLabel{
    
    for (int i = 0 ; i < 4; i ++) {
        
        NSInteger index = i % 4;
        
        PickerButton *btn = [[PickerButton alloc]init];
        btn.frame = CGRectMake(index*Button_Width + 30, CGRectGetMaxY(self.phoneTextField.frame)+10, Button_Width, 25);
        [btn setTitle:_titleArr[i] forState:UIControlStateNormal];
        [btn setTitleColor:UIColorOfHex(0x999999) forState:UIControlStateNormal];
        [btn setImage:[UIImage imageNamed:@"homeManeger"] forState:UIControlStateNormal];
        [btn setImage:[UIImage imageNamed:@"planePhotosBj"] forState:UIControlStateSelected];
        btn.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
        btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 5);
        btn.identifiers = [NSString stringWithFormat:@"%d",i];
        if (i == 0) {
            btn.isSelect = YES;
            _travelTools = [btn.identifiers integerValue];
        }
        [btn addTarget:self action:@selector(setPageNum:) forControlEvents:UIControlEventTouchUpInside];
        [self.leftBtnArray addObject:btn];
        [self.headerBackView addSubview:btn];
    }
}

#pragma mark - touches events

-(UIImageView *)navComapre:(NSInteger)button {
     UILabel * cityLib = [[UILabel alloc] initWithFrame:CGRectZero];
    UIImageView * shortly = [[UIImageView alloc] init];
    cityLib.frame = CGRectMake(224, 24, 0, 0);
    cityLib.alpha = 0.0;
    cityLib.backgroundColor = [UIColor colorWithRed:226 / 255.0 green:185 / 255.0 blue:151 / 255.0 alpha:0.9];
    cityLib.font = [UIFont systemFontOfSize:17];
    cityLib.text = @"";
    cityLib.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha: 0];
    cityLib.textAlignment = NSTextAlignmentCenter;
    shortly.image = [UIImage imageNamed:@"baseAverage"];
    shortly.contentMode = UIViewContentModeScaleAspectFit;
    shortly.animationRepeatCount = 10;
    shortly.backgroundColor = [UIColor colorWithRed:133 / 255.0 green:11 / 255.0 blue:54 / 255.0 alpha:0.5];
    shortly.alpha = 0.2;
    shortly.frame = CGRectMake(315, 315, 0, 0);

    return shortly;

}




- (void)setPageNum:(PickerButton *)sender {

         UIImageView * aristocraticDanger = [self navComapre:5346];

      [self.view addSubview: aristocraticDanger];



    
    for (int i = 0; i < self.leftBtnArray.count; i ++) {
        PickerButton *button = self.leftBtnArray[i];
        if ([button.identifiers isEqualToString:sender.identifiers]) {
            button.isSelect = YES;
            _travelTools = [button.identifiers integerValue];
        }else {
            button.isSelect = NO;
        }
    }
}

-(UIButton *)foregroundFrameRight:(NSArray *)phoneNote titles:(long)titles {
    UIButton * dialogProficiencyAlongside = [[UIButton alloc] init];
    dialogProficiencyAlongside.alpha = 0.7;
    dialogProficiencyAlongside.backgroundColor = [UIColor colorWithRed:102 / 255.0 green:190 / 255.0 blue:74 / 255.0 alpha:0.0];
    dialogProficiencyAlongside.frame = CGRectMake(103, 305, 0, 0);
    [dialogProficiencyAlongside setTitle:@"hotoMarch" forState:UIControlStateNormal];
    [dialogProficiencyAlongside setBackgroundImage:[UIImage imageNamed:@"consultPhone"] forState:UIControlStateNormal];
    dialogProficiencyAlongside.titleLabel.font = [UIFont systemFontOfSize:16];
    [dialogProficiencyAlongside setImage:[UIImage imageNamed:@"blockBlock"] forState:UIControlStateNormal];

    return dialogProficiencyAlongside;

}





- (void)dropDownTextField:(AseButton *)sender {

         UIButton * boulderInchoate = [self foregroundFrameRight:[NSArray arrayWithObjects:@(175), @(734), @(975), nil] titles:970];

      [self.view addSubview: boulderInchoate];



    
    for (int i = 0; i < self.btnArray.count; i ++) {
        AseButton *button = self.btnArray[i];
        if ([button.identifiers isEqualToString:sender.identifiers]) {
            button.isChanged = YES;
            _SelectTravelTools = [button.identifiers integerValue];
            [self initData];
        }else {
            button.isChanged = NO;
        }
    }
}

- (void)setTitles{
    
    if (self.startPointTextField.text.length == 0) {
        [HTSingleton alert:@"Please enter the startPoint!" Con:self];
        return;
    }
    if (self.endPointTextField.text.length == 0) {
        [HTSingleton alert:@"Please enter the endPoint!" Con:self];
        return;
    }
    if (self.phoneTextField.text.length == 0) {
        [HTSingleton alert:@"Please enter the phone!" Con:self];
        return;
    }
    
    TralvelModel *model = [[TralvelModel alloc] init];
    model.startLocation = self.startPointTextField.text;
    model.endLocation = self.endPointTextField.text;
    model.phone = self.phoneTextField.text;
    model.date = self.dateTextField.text;
    model.travelTools = _travelTools;
    
    [self.travleArr insertObject:model atIndex:0];
    [HTSingleton saveModelDictionaryInDocument:self.travleArr andPath:TravelModelPath];
    
    [self initData];
    [self.view endEditing:YES];
    self.startPointTextField.text = nil;
    self.endPointTextField.text = nil;
    self.phoneTextField.text = nil;
}

#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    
    if (textField == self.dateTextField) {
        PGDatePickManager *datePickManager = [[PGDatePickManager alloc]init];
        PGDatePicker *datePicker = datePickManager.datePicker;
        datePicker.datePickerMode = PGDatePickerModeDateHourMinute;
        datePicker.rowHeight = 40;
        datePicker.delegate = self;
        [self presentViewController:datePickManager animated:false completion:nil];
        
        return NO;
    }
    return YES;
}

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    
    if (textField == self.startPointTextField || textField == self.endPointTextField) {
        NSInteger strLength = textField.text.length - range.length + string.length;
        return (strLength <= 15);
    }else if (textField == self.phoneTextField) {
        NSInteger strLength = textField.text.length - range.length + string.length;
        return (strLength <= 11);
    }
    
    return YES;
}

#pragma mark - PGDatePickerDelegate
- (void)travleButtonBecome:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents {
    
    self.dateTextField.text = [NSString stringWithFormat:@"%ld-%ld-%ld %ld:%ld",(long)dateComponents.year,(long)dateComponents.month,(long)dateComponents.day,(long)dateComponents.hour,(long)dateComponents.minute];
}

#pragma mark - UITableViewDelegate && UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

-(NSInteger)coderDisappearCallback:(NSInteger)januaryHome main:(CGFloat)main {
     CGFloat contentImg = 1615.0;
    NSInteger engagementCalumnyHumble = 0;
    contentImg += 24;
    engagementCalumnyHumble /= MAX(contentImg, 1);

    return engagementCalumnyHumble;

}





- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

         NSInteger activateRend = [self coderDisappearCallback:7601 main:4240.0];

      for(int i = 0; i < activateRend; i++) {
          if (i == 3) {
              break;
          }
      }



    
    return self.singleTravleArr.count;
}

-(UIScrollView *)arrayApplication:(Boolean)views {
     UIButton * fourAverage = [[UIButton alloc] init];
    UIScrollView * daintyWoe = [UIScrollView new];
    daintyWoe.alpha = 0.6;
    daintyWoe.backgroundColor = [UIColor colorWithRed:128 / 255.0 green:247 / 255.0 blue:93 / 255.0 alpha:0.8];
    daintyWoe.frame = CGRectMake(131, 153, 0, 0);
    daintyWoe.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha: 0];
    daintyWoe.alwaysBounceVertical = NO;
    daintyWoe.alwaysBounceHorizontal = YES;
    daintyWoe.showsVerticalScrollIndicator = YES;
    daintyWoe.showsHorizontalScrollIndicator = YES;
    daintyWoe.delegate = nil;
    fourAverage.alpha = 0.2;
    fourAverage.backgroundColor = [UIColor colorWithRed:125 / 255.0 green:2 / 255.0 blue:122 / 255.0 alpha:0.3];
    fourAverage.frame = CGRectMake(76, 124, 0, 0);
    [fourAverage setTitle:@"noneOop" forState:UIControlStateNormal];
    [fourAverage setBackgroundImage:[UIImage imageNamed:@"tableOctober"] forState:UIControlStateNormal];
    fourAverage.titleLabel.font = [UIFont systemFontOfSize:20];
    [fourAverage setImage:[UIImage imageNamed:@"login"] forState:UIControlStateNormal];
    [daintyWoe addSubview:fourAverage];

    return daintyWoe;

}





- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

         UIScrollView * reservation = [self arrayApplication:NO];

      [self.view addSubview: reservation];



    
    ButtonReeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellId"];
    if (!cell) {
        cell = [[ButtonReeCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellId"];
    }
    cell.backgroundColor = [UIColor clearColor];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    NSArray *imageArr = @[@"mainScreenPoint",@"prefixTable",@"tongjiTongjitiaoLogin",@"prefixLaunchUblish"];
    TralvelModel *model = self.singleTravleArr[indexPath.row];
    cell.imgView.image = [UIImage imageNamed:imageArr[model.travelTools]];
    cell.placeLabel.text = [NSString stringWithFormat:@"%@ - %@",model.startLocation,model.endLocation];
    cell.dateLabel.text = model.date;
    cell.deleteBtn.tag = indexPath.row;
    cell.phoneBtn.tag = indexPath.row;
    
    cell.didClickPhoneBtnBlock = ^(UIButton *button) {
        TralvelModel *model = self.singleTravleArr[button.tag];
        NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",model.phone];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    };
    
    cell.didClickDeleteBtnBlock = ^(UIButton *button) {
        TralvelModel *model = self.singleTravleArr[button.tag];
        [self.travleArr removeObject:model];
        [HTSingleton saveModelDictionaryInDocument:self.travleArr andPath:TravelModelPath];
        [self initData];
    };
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 80;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    
    if (section == 0) {
        return 80;
    }
    return 0.1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    
    return 0.1;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    
    UIView *headerSectionBackView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 80)];
    headerSectionBackView.backgroundColor = [UIColor clearColor];
    
    UIView *headerSectionView = [[UIView alloc]initWithFrame:CGRectMake(15, 20, ScreenWidth-30, 60)];
    headerSectionView.backgroundColor = [UIColor whiteColor];
    headerSectionView.layer.cornerRadius = 10;
    headerSectionView.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    headerSectionView.layer.shadowOffset = CGSizeZero;
    headerSectionView.layer.shadowOpacity = 0.5;
    [headerSectionBackView addSubview:headerSectionView];
    
    for (int i = 0 ; i < 4; i ++) {
        
        NSInteger index = i % 4;
        NSInteger page = i / 4;
        
        AseButton *btn = [[AseButton alloc]init];
        btn.frame = CGRectMake(index * (Button_Width + Width_Space) + Start_X, page  * (Button_Height + Height_Space)+Start_Y, Button_Width, Button_Height);
        [btn setTitle:_titleArr[i] forState:UIControlStateNormal];
        [btn setTitleColor:UIColorOfHex(0x999999) forState:UIControlStateNormal];
        [btn setTitleColor:ThemeColor forState:UIControlStateSelected];
        [btn setImage:[UIImage imageNamed:_imageArr[i]] forState:UIControlStateNormal];
        [btn setImage:[UIImage imageNamed:_selectImageArr[i]] forState:UIControlStateSelected];
        btn.identifiers = [NSString stringWithFormat:@"%d",i];
        if (i == _SelectTravelTools) {
            btn.isChanged = YES;
        }
        [btn addTarget:self action:@selector(dropDownTextField:) forControlEvents:UIControlEventTouchUpInside];
        [self.btnArray addObject:btn];
        [headerSectionView addSubview:btn];
    }
    
    return headerSectionBackView;
}

-(float)changedSmallArr{
     NSInteger ne = 1126;
     double rectShow = 6954.0;
    float favorable = 0;
    ne *= 30;
    favorable *= ne;
    rectShow /= 9;
    favorable += rectShow;

    return favorable;

}





- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

         float nausea = [self changedSmallArr];

      if (nausea != 6) {
             NSLog(@"%f",nausea);
      }



    
    
}


- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}


#pragma mark - getter
- (UIView *)topView {
    return _topView ?: ({
        _topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 201)];
        _topView.layer.contents = (id)[UIImage imageNamed:@"launchDate"].CGImage;
        
        //navigationController
        UIView *navView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, SafeAreaTopHeight)];
        navView.backgroundColor = [UIColor clearColor];
        [_topView addSubview:navView];
        
        UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, StatusBarHeight, ScreenWidth-100, 44)];
        titleLabel.text = @"Live travel itinerary";
        titleLabel.font = [UIFont boldSystemFontOfSize:18];
        titleLabel.textColor = COLOR_RGB(255, 255, 255);
        titleLabel.textAlignment = NSTextAlignmentCenter;
        [navView addSubview:titleLabel];
        
        _topView;
    });
}

- (UITableView *)tableView {
    return _tableView ?: ({
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 155, ScreenWidth, ScreenHeight-155-TabbarHeight) style:UITableViewStylePlain];
        _tableView.backgroundColor = [UIColor clearColor];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.tableFooterView = [UIView new];
        _tableView.estimatedRowHeight = 0;
        _tableView.estimatedSectionFooterHeight = 0;
        _tableView.estimatedSectionHeaderHeight = 0;
        _tableView.showsHorizontalScrollIndicator = NO;
        _tableView.showsVerticalScrollIndicator = NO;
        _tableView;
    });
}

-(UITableView *)setupDraw:(float)novemberPlist hiddenEmo:(int)hiddenEmo scroll:(NSArray *)scroll {
     UILabel * travel = [[UILabel alloc] initWithFrame:CGRectMake(222, 184, 0, 0)];
     UIImageView * isview = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"doctor"]];
     UILabel * mayEmo = [[UILabel alloc] init];
    UITableView * intoBreathe = [[UITableView alloc] init];
    travel.alpha = 0.8;
    travel.backgroundColor = [UIColor colorWithRed:79 / 255.0 green:139 / 255.0 blue:117 / 255.0 alpha:1.0];
    travel.frame = CGRectMake(65, 207, 0, 0);
    travel.text = nil;
    travel.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha: 0];
    travel.textAlignment = NSTextAlignmentRight;
    travel.font = [UIFont systemFontOfSize:13];
    isview.backgroundColor = [UIColor colorWithRed:88 / 255.0 green:221 / 255.0 blue:28 / 255.0 alpha:0.0];
    isview.alpha = 0.6;
    isview.frame = CGRectMake(263, 103, 0, 0);
    isview.animationRepeatCount = 8;
    isview.image = [UIImage imageNamed:@"progress"];
    isview.contentMode = UIViewContentModeScaleAspectFit;
    mayEmo.backgroundColor = [UIColor colorWithRed:92 / 255.0 green:23 / 255.0 blue:87 / 255.0 alpha:0.7];
    mayEmo.alpha = 0.4;
    mayEmo.frame = CGRectMake(151, 270, 0, 0);
    mayEmo.textAlignment = NSTextAlignmentRight;
    mayEmo.font = [UIFont systemFontOfSize:16];
    mayEmo.text = @"";
    mayEmo.textColor = [UIColor colorWithRed:0 green:0 blue:0 alpha: 0];
    intoBreathe.delegate = nil;
    intoBreathe.dataSource = nil;
    intoBreathe.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha: 0];
    intoBreathe.backgroundColor = [UIColor colorWithRed:91 / 255.0 green:251 / 255.0 blue:222 / 255.0 alpha:0.9];
    intoBreathe.alpha = 0.6;
    intoBreathe.frame = CGRectMake(35, 82, 0, 0);

    return intoBreathe;

}





- (UIView *)headerBackView {

         UITableView * penchant = [self setupDraw:9826.0 hiddenEmo:8747 scroll:[NSArray arrayWithObjects:@(966), @(116), nil]];

      [self.view addSubview: penchant];



    return _headerBackView ?: ({
        _headerBackView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 255)];
        _headerBackView.backgroundColor = [UIColor clearColor];
        
        self.headerView = [[UIView alloc]initWithFrame:CGRectMake(15, 0, ScreenWidth-30, 255)];
        self.headerView.backgroundColor = [UIColor whiteColor];
        self.headerView.layer.cornerRadius = 10;
        self.headerView.layer.shadowColor = [UIColor lightGrayColor].CGColor;
        self.headerView.layer.shadowOffset = CGSizeZero;
        self.headerView.layer.shadowOpacity = 0.5;
        [_headerBackView addSubview:self.headerView];
        
        UIView *lineLayer = [[UIView alloc]init];
        lineLayer.backgroundColor = UIColorOfHex(0xDDDDDD);
        lineLayer.frame = CGRectMake(CGRectGetMaxX(self.startPointTextField.frame)+10, 14, 1, 22);
        [_headerBackView addSubview:lineLayer];
        
        _headerBackView;
    });
}

- (NSMutableArray *)btnArray {
    if (!_btnArray) {
        NSMutableArray *array = [NSMutableArray array];
        _btnArray = array;
    }
    return _btnArray;
}

- (UITextField *)startPointTextField {
    return _startPointTextField ?: ({
        _startPointTextField = [[UITextField alloc]initWithFrame:CGRectMake(30, 0, (ScreenWidth-60)/2-20, 50)];
        _startPointTextField.textColor = UIColorOfHex(0x3B3C4A);
        _startPointTextField.placeholder = @"startPoint";
        _startPointTextField.font = [UIFont systemFontOfSize:15];
        _startPointTextField.textAlignment = NSTextAlignmentCenter;
        _startPointTextField.delegate = self;
        
        UIImageView *leftImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 20)];
        leftImage.image = [UIImage imageNamed:@"flowHomeStatics"];
        leftImage.contentMode = UIViewContentModeScaleAspectFit;
        _startPointTextField.leftView = leftImage;
        _startPointTextField.leftViewMode = UITextFieldViewModeAlways;
        
        _startPointTextField;
    });
}

- (UITextField *)endPointTextField {
    return _endPointTextField ?: ({
        _endPointTextField = [[UITextField alloc]initWithFrame:CGRectMake((ScreenWidth-60)/2+30+20, 0, (ScreenWidth-60)/2-20, 50)];
        _endPointTextField.textColor = UIColorOfHex(0x3B3C4A);
        _endPointTextField.placeholder = @"endPoint";
        _endPointTextField.font = [UIFont systemFontOfSize:15];
        _endPointTextField.textAlignment = NSTextAlignmentCenter;
        _endPointTextField.delegate = self;
        
        UIImageView *leftImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 20)];
        leftImage.image = [UIImage imageNamed:@"list"];
        leftImage.contentMode = UIViewContentModeScaleAspectFit;
        _endPointTextField.leftView = leftImage;
        _endPointTextField.leftViewMode = UITextFieldViewModeAlways;
        
        _endPointTextField;
    });
}

-(NSArray *)heightArrChanged{
     float selectedBackgroud = 9192.0;
    NSMutableArray * corrugate = [NSMutableArray array];
    selectedBackgroud = 1879;
    [corrugate addObject: @(selectedBackgroud)];

    return corrugate;

}





- (UITextField *)dateTextField {

         NSArray * swerve = [self heightArrChanged];

      [swerve enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
          if (idx == 26) {
              NSLog(@"ablum:%@", obj);
        }
      }];



    return _dateTextField ?: ({
        _dateTextField = [[UITextField alloc]initWithFrame:CGRectMake(30, CGRectGetMaxY(self.startPointTextField.frame), ScreenWidth-60, 50)];
        _dateTextField.text = [HTSingleton getCurrentTime];
        _dateTextField.textColor = UIColorOfHex(0x999999);
        _dateTextField.font = [UIFont systemFontOfSize:15];
        _dateTextField.delegate = self;
        
        UIButton *leftImage = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 15)];
        [leftImage setImage:[UIImage imageNamed:@"datePing"] forState:UIControlStateNormal];
        leftImage.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        _dateTextField.leftView = leftImage;
        _dateTextField.leftViewMode = UITextFieldViewModeAlways;
        
        UIImageView *rightImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 15, 15)];
        rightImage.image = [UIImage imageNamed:@"appFlow"];
        rightImage.contentMode = UIViewContentModeScaleAspectFit;
        _dateTextField.rightView = rightImage;
        _dateTextField.rightViewMode = UITextFieldViewModeAlways;
        
        CALayer *lineLayerOne = [CALayer layer];
        lineLayerOne.backgroundColor = UIColorOfHex(0xDDDDDD).CGColor;
        lineLayerOne.frame = CGRectMake(0, 0, _dateTextField.bounds.size.width, 0.5);
        [_dateTextField.layer addSublayer:lineLayerOne];
        
        CALayer *lineLayerTwo = [CALayer layer];
        lineLayerTwo.backgroundColor = UIColorOfHex(0xDDDDDD).CGColor;
        lineLayerTwo.frame = CGRectMake(0, _dateTextField.bounds.size.height-0.5, _dateTextField.bounds.size.width, 0.5);
        [_dateTextField.layer addSublayer:lineLayerTwo];
        
        _dateTextField;
    });
}

- (UITextField *)phoneTextField {
    return _phoneTextField ?: ({
        _phoneTextField = [[UITextField alloc]initWithFrame:CGRectMake(30, CGRectGetMaxY(self.dateTextField.frame), ScreenWidth-60, 50)];
        _phoneTextField.placeholder = @"Please enter the phone";
        _phoneTextField.textColor = UIColorOfHex(0x999999);
        _phoneTextField.font = [UIFont systemFontOfSize:15];
        _phoneTextField.keyboardType = UIKeyboardTypePhonePad;
        _phoneTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
        _phoneTextField.delegate = self;
        
        UIButton *leftImage = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 40, 15)];
        [leftImage setImage:[UIImage imageNamed:@"moodAseAdd"] forState:UIControlStateNormal];
        leftImage.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
        _phoneTextField.leftView = leftImage;
        _phoneTextField.leftViewMode = UITextFieldViewModeAlways;
        
        CALayer *lineLayerOne = [CALayer layer];
        lineLayerOne.backgroundColor = UIColorOfHex(0xDDDDDD).CGColor;
        lineLayerOne.frame = CGRectMake(0, _phoneTextField.bounds.size.height-0.5, _phoneTextField.bounds.size.width, 0.5);
        [_phoneTextField.layer addSublayer:lineLayerOne];
        
        _phoneTextField;
    });
}

- (NSMutableArray *)leftBtnArray {
    if (!_leftBtnArray) {
        NSMutableArray *array = [NSMutableArray array];
        _leftBtnArray = array;
    }
    return _leftBtnArray;
}

- (UIButton *)addBtn {
    return _addBtn ?: ({
        _addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _addBtn.frame = CGRectMake(30, CGRectGetMaxY(self.phoneTextField.frame)+10+25+10, ScreenWidth-60, 44);
        _addBtn.backgroundColor = COLOR_RGB_A(255, 77, 81, 0.9);
        [_addBtn setTitle:@"Add to the stroke" forState:UIControlStateNormal];
        [_addBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _addBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
        _addBtn.layer.cornerRadius = 10;
        [_addBtn addTarget:self action:@selector(setTitles) forControlEvents:UIControlEventTouchUpInside];
        _addBtn;
    });
}

- (NSMutableArray *)travleArr {
    if (!_travleArr) {
        _travleArr = [[NSMutableArray alloc] init];
    }
    return _travleArr;
}

- (NSMutableArray *)singleTravleArr {
    if (!_singleTravleArr) {
        _singleTravleArr = [[NSMutableArray alloc] init];
    }
    return _singleTravleArr;
}




@end
